<?php

namespace App\Http\Controllers\Web;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Model\News,App\Model\Businesses,App\Model\Knowledges;
use App\Model\About;
class HomeController extends Controller
{
    //
    public function home(){
        $news = [
            0 => News::getData(0),
            1 => News::getData(1),
            2 => News::getData(2),
            3 => News::getData(3),
            4 => News::getData(4),
        ];
        $businesses = [
            0 => Businesses::getData(0),
            1 => Businesses::getData(1),
            2 => Businesses::getData(2),
        ];
        $knowledges = [
            0 => Knowledges::getData(0),
            1 => Knowledges::getData(1),
            2 => Knowledges::getData(2),
        ];
        $about = About::find(1);
        return view('home',[
            'currentNav' => 'home',
            'new' => $news,
            'businesses' => $businesses,
            'knowledges' => $knowledges,
            'images' => json_decode($about->images)
        ]);
    }
}
